<!doctype html> 
<html> 
<head> 
  <meta charset="utf-8"/>
  <title>后台管理系统</title>
  <meta name="author" content="DeathGhost" />
  <link rel="stylesheet" type="text/css" href="css/style.css" />
  <!--[if lt IE 9]>
  <script src="js/html5.js"></script>
  <![endif]-->
  <style>
  .table{text-align: center;}
  </style>
<script src="js/jquery.js"></script>
<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
<script>
  (function($){
    $(window).load(function(){
      
      $("a[rel='load-content']").click(function(e){
        e.preventDefault();
        var url=$(this).attr("href");
        $.get(url,function(data){
          $(".content .mCSB_container").append(data); //load new content inside .mCSB_container
          //scroll-to appended content 
          $(".content").mCustomScrollbar("scrollTo","h2:last");
        });
      });
      
      $(".content").delegate("a[href='top']","click",function(e){
        e.preventDefault();
        $(".content").mCustomScrollbar("scrollTo",$(this).attr("href"));
      });
      
    });
  })(jQuery);
</script>

</head>
<body>
@if($v=='z')
  <section class="rt_wrap content mCustomScrollbar">
 <div class="rt_content">
     
     <section>
      <h2><strong style="color:grey;"></strong></h2>
      <div class="page_title">
       <h2 class="fl">管理员列表</h2>
       <a class="fr top_rt_btn" href="adminList?d=d">添加管理员</a>
      </div>
      <table class="table">
       <tr>
        <th>编号</th>
        <th>用户名</th>
        <th>状态</th>
        <th>角色</th>
        <th>邮箱</th>
        <th>手机号</th>
        <th>操作</th>
       </tr>
       @foreach( $list as $v)
       <tr>
        <td>{{$v->admin_id}}</td>
        <td>{{$v->admin_user}}</td>
        <td>
        @if($v->admin_stu==0)
        启用
        @else
        禁用
        @endif
        </td>
        <td>{{$v->admin_role_name}}</td>
        <td>{{$v->admin_email}}</td>
        <td>{{$v->admin_phone}}</td>
        <td>
         <a href="javascript:void(0);" dels='{{$v->admin_id}}' class="dels">删除</a>
        </td>
       </tr>
       @endforeach
      </table>
     <!--  <aside class="paging">
       <a>第一页</a>
       <a>1</a>
       <a>2</a>
       <a>3</a>
       <a>…</a>
       <a>1004</a>
       <a>最后一页</a>
      </aside> -->
     </section>
     <script>
     $('.dels').click(function(){
      var dels=$(this).parent().parent();
      var id=$(this).attr('dels');
      var data={'id':id,'do':'dels','_token':"{{ csrf_token()}}"};
      var url='adminList';
      $.post(url,data,function(msg){
         if(msg){
          dels.remove();
         }
      })
     })
     </script>

 </div>
</section>

@else


<section class="rt_wrap content mCustomScrollbar">
 <div class="rt_content">
     

     <section>
      <div class="page_title">
      <h2><strong style="color:grey;">添加管理员</strong><a class="fr top_rt_btn"   href="adminList" target='mainFrame'>管理员列表</a></h2>
      </div>
      <form action="adminList" method="post">
      <input type="hidden" name="_token" value="{{csrf_token()}}">
      <input type="hidden" name="do" value="in">
      <ul class="ulColumn2">
       <li>
        <span class="item_name" style="width:120px;">管理员名称：</span>
        <input type="text" name="admin_user" class="textbox textbox_295" placeholder="文本信息提示..."/>
        
       </li>
       <li>
        <span class="item_name" style="width:120px;">密码：</span>
        <input type="text" name="admin_pwd" class="textbox textbox_295" placeholder="文本信息提示..."/>
       
       </li>
       <li>
        <span class="item_name" style="width:120px;">email：</span>
        <input type="text" name="admin_email" class="textbox textbox_295" placeholder="文本信息提示..."/>
       
       </li>
       <li>
        <span class="item_name" style="width:120px;">手机号：</span>
        <input type="text" name="admin_phone" class="textbox textbox_295" placeholder="文本信息提示..."/>
     
       </li>
       <li>
        <span class="item_name" style="width:120px;">是否启用：</span>
        <label class="single_selection"><input type="radio" name="admin_stu" value="0" checked="checked" />启用</label>
        <label class="single_selection"><input type="radio" name="admin_stu" value="1" />不启用</label>
       </li>
       <li>
         <span class="item_name" style="width:120px;">角色：</span>
         <select class="select" name="admin_rid">
          @foreach($list1 as $j)
           <option value="{{$j->admin_rid}}">{{$j->admin_role_name}}</option>
          @endforeach
          </select>
       </li>
       <li>
        <span class="item_name" style="width:120px;"></span>
        <input type="submit" class="link_btn" value="添加管理员" />
       </li>
      </ul>
      </form>
     </section>
 </div>
</section>

@endif
</body>
<script type="text/javascript">
</script>
</html>


